home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: news.ifm.liu.se!liuida!news
- From: c92manen@und.ida.liu.se (Mans Engman)
- Subject: Re: 680X0 -> PPC translator?
- X-Nntp-Posting-Host: astmatix.ida.liu.se
- Message-ID: <1586.6669T961T2657@und.ida.liu.se>
- Sender: news@ida.liu.se
- Organization: CIS Dept, Linkoping University, Sweden
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
- References: <31499F8E.26A9@netvision.net.il> <volker.0fw1@vb.franken.de>
- <315800D7.1854@sapiens.com> <volker.0g32@vb.franken.de>
- <315C198B.49C2@netvision.net.il> <volker.0g5w@vb.franken.de>
- <1996Apr2.230841.8275@scala.scala.com> <31640B0C.23F5@netvision.net.il>
- Date: Fri, 5 Apr 1996 15:01:53 GMT
-
- Once you think a bit, it's easy to show (prove!) that static code<->data
- distinction can't be determined by an algorithm. It is what theorists call
- an "undecidable" problem. Granted, for a "real" computer with a finite amount
- of memory/indata it can be "solved" by brute-force search, but this is
- not a practical approach.
-
- Okay, let's go on:
-
- 1) Hilberts 10th problem is a well known, proven undecidable problem. The
- problem is determining whether an integer polynomial equation has a
- (integer) solution.
-
- Example: Does 3x^2 + 2xy + 9x + 5 = 0 have a solution for some integers x, y?
- In this case we can of course easily see that it doesn't, but an algorithm
- *can't* decide this for arbitrary equations, except for the special case of
- 1st degree polynomials (Euclides! :).
-
- 2) Now imagine a program calculating some function on the indata x, y, ...
- and uses the result as a pc-relative address where we jump. This function,
- and the rest of the program can be constructed such that for all x, y, ...
- we jump to a legal piece of code. Between these code chunks we will of
- course put data to confuse anyone analysing the program! :)
-
- 3) An algorithm that can determine code reachability of this program,
- would either:
-
- i) try different combinations of inputs and simulate the program. Inputs
- include outside calls, memory reads (that may change anytime), or other
- undecidable functions. To be sure the algorithm would have to try *all* of
- them. Combinatorial-explosion-city?
-
- ii) include an algorithm to solve the "10th", which is proven impossible.
-
- QED.
-
- /Mans (.sig being recompiled)
-
-